package xhwl.insurance.http.api;

import com.google.gson.Gson;

import okhttp3.RequestBody;
import rx.Observable;
import xhwl.insurance.http.ApiService;
import xhwl.retrofitrx.BaseApi;

/**
 * Created by Administrator on 2017/10/12.
 */

public class ForumSearchApi extends BaseApi {
    SearchReq req;

    public ForumSearchApi(String key_word) {
        req = new SearchReq(key_word);
        setShowDialog(false);

    }

    @Override
    protected Observable getObservable() {
        RequestBody requestBody = RequestBody.create(okhttp3.MediaType.parse("application/json; charset=utf-8"), new Gson().toJson(req));
        return retrofit.create(ApiService.class).getforumSearchInfo(requestBody);
    }

    class SearchReq {
        String key_word;

        public SearchReq(String key_word) {
            this.key_word = key_word;
        }
    }
}
